package com.xpgk.mvc.statistic.dailyNursing;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.jfinal.log.Log;
import com.jfinal.plugin.activerecord.Record;
import com.xpgk.annotation.Service;
import com.xpgk.mvc.base.BaseService;

@Service(name = DailyNursingStatisticService.serviceName)
public class DailyNursingStatisticService extends  BaseService{
	@SuppressWarnings("unused")
	private static final Log log = Log.getLog(DailyNursingStatisticService.class);
	public static final String serviceName = "dailyNursingStatisticService";
	
	
	public  List<Record>  getDailyNursingInfo(String month,String organIds,String name,String phone,String hybh,
			String  fzUser,String  arrivedMinTimes,String  arrivedMaxTimes) throws Exception{	
		    Map<String, Object> queryParam = new HashMap<String, Object>();
		    queryParam.put("lastMonth", month);
			queryParam.put("month", month);
			queryParam.put("scOrganIds", organIds);
			queryParam.put("ssOrganIds", organIds);
			queryParam.put("cusname", name);
			queryParam.put("cusphone", phone);
			if(hybh!=null && !hybh.equals("")){
				queryParam.put("cushybh", String.format("%06d",Integer.parseInt(hybh)));
			}
			queryParam.put("fzUser", "");
			if(!fzUser.equals("-1")){
				queryParam.put("fzUser", fzUser);
			}
			queryParam.put("arrivedMinTimes", arrivedMinTimes);
			queryParam.put("arrivedMaxTimes", arrivedMaxTimes);
			
			
			List<Record> cuslist = find(DailyNursingStatisticSQL.sqlId_selCustomer, queryParam);
			
		return  cuslist;
	}
	

}
